package com.itheima;

public class ShuZi {
    public static void main(String[] args) {
        int count = 0;
        for (int num = 1000; num <= 9999; num++) {
            int ge = num % 10;
            int shi = num / 10 % 10;
            int bai = num / 100 % 10;
            int qian = num / 1000 % 10;
            int sum = ge + qian;
            int sum1 = shi + bai;
            if (sum == sum1) {
                count++;
                System.out.print(num + " ");
             if (count % 5 == 0) {
                System.out.println();
             }
        }
        }
        System.out.println("个数为" + count);
    }

}